import { http } from '@/utils/axios';
import { Base } from '@/types/modules/base';

export function querySelfInfo() {
  return http.request<Staff.StaffInfoTO>({
    url: '/v1/basic/staff/self',
    method: 'GET',
  });
}

export function page(data: Staff.QueryStaffReq) {
  return http.request<Base.PageResult<Staff.StaffInfoTO>>({
    url: '/v1/basic/staff/page',
    method: 'POST',
    data,
  });
}

export function detail(id: any) {
  return http.request<Staff.StaffInfoTO>({
    url: `/v1/basic/staff/detail/${id}`,
    method: 'GET',
  });
}

export function create(data: Staff.StaffInfoTO) {
  return http.request({
    url: '/v1/basic/staff/create',
    method: 'POST',
    data,
  });
}

export function modify(data: Staff.StaffInfoTO) {
  return http.request({
    url: '/v1/basic/staff/modify',
    method: 'POST',
    data,
  });
}

export function remove(id: string) {
  return http.request({
    url: `/v1/basic/staff/${id}`,
    method: 'DELETE',
  });
}

export function listAll(data: Staff.QueryStaffReq) {
  return http.request<Staff.StaffInfoTO[]>({
    url: '/v1/basic/staff/list',
    method: 'POST',
    data,
  });
}
